<?php
/**
 * Author Yulin
 * Email  dwzhanglong@126.com
 * Date   2017-9-19
 * Func   香港时时彩（信用玩法）
 */
defined('IN_YuLin') || exit('NO PERMIT!');

//	返回中奖金额	data为订单信息，plays为玩法

function PrizeCount_23($data,$plays)
{
	if(!$data || !$data['result'] || !$plays)
	{
		return 0;
	}
	
	//	玩法
	$result = explode(',',$data['result']);
	
	//	波色
	$bohong = [1,2,12,13,23,24,34,35,45,46,7,8,18,19,29,30,40];
	$bolan = [31,41,42,3,4,14,15,25,26,36,37,47,48,9,10,20];
	$bolv = [11,21,22,32,33,43,44,5,6,16,17,27,28,38,39,49];
	
	//	特码波色、大小、单双、合、特肖
	$tehong = in_array($result[6],$bohong);
	$telan = in_array($result[6],$bolan);
	$telv = in_array($result[6],$bolv);
	$tedan = $result[6] % 2;
	$teda = $result[6] > 24;
	$tehe = $result[6] > 9 ? substr($result[6],0,1) + substr($result[6],1,1) : $result[6];
	$texiao = Num2Animal(date('Y'),$result[6]);
	
	//	特码
	if($plays['parentid'] == 457)
	{		
		return $data['rednum'] == $result[6] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	特码色波	红波
	if($plays['playid'] == 1453)
	{
		return $tehong ? $data['money'] * $data['odds'] : 0;
	}
	//	特码色波	蓝波
	if($plays['playid'] == 1454)
	{
		return $telan ? $data['money'] * $data['odds'] : 0;
	}
	//	特码色波	绿波
	if($plays['playid'] == 1455)
	{
		return $telv ? $data['money'] * $data['odds'] : 0;
	}
	
	//	特码大小	49和
	if($plays['parentid'] == 461)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($plays['playid'] == 1456)
		{
			return $teda ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1457)
		{
			return !$teda ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特码单双	49和
	if($plays['parentid'] == 462)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($plays['playid'] == 1458)
		{
			return $tedan ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1459)
		{
			return !$tedan ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特码合大小	49：和 合13：和
	if($plays['parentid'] == 463)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($tehe == 13)
		{
			return 0;
		}
		
		if($plays['playid'] == 1460)
		{
			return ($tehe > 0) && ($tehe < 7) ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1461)
		{
			return ($tehe > 6) && ($tehe < 13) ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特码合单双	49：和
	if($plays['parentid'] == 464)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($plays['playid'] == 1462)
		{
			return $tehe % 2 ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1463)
		{
			return $tehe % 2 == 0 ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特码尾大小	49：和
	if($plays['parentid'] == 465)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($plays['playid'] == 1464)
		{
			return (substr($result[6],-1) > 4) ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1465)
		{
			return (substr($result[6],-1) < 5) ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	家禽、野兽	49：和
	if($plays['parentid'] == 466)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		if($plays['playid'] == 1466)
		{
			return in_array($texiao,['牛','马','羊','鸡','狗','猪']) ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1467)
		{
			return in_array($texiao,['鼠','虎','龙','蛇','兔','猴']) ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	总和
	$zonghe = $result[0] + $result[1] + $result[2] + $result[3] + $result[4] + $result[5] + $result[6];
	
	//	总和大小
	if($plays['playid'] == 1468)
	{
		return $zonghe > 174 ? $data['money'] * $data['odds'] : 0;
	}
	if($plays['playid'] == 1469)
	{
		return $zonghe < 175 ? $data['money'] * $data['odds'] : 0;
	}
	
	//	总和单双
	if($plays['playid'] == 1470)
	{
		return $zonghe % 2 ? $data['money'] * $data['odds'] : 0;
	}
	if($plays['playid'] == 1471)
	{
		return $zonghe % 2 == 0 ? $data['money'] * $data['odds'] : 0;
	}
	
	//	特合尾大小	25：和
	if($plays['parentid'] == 464)
	{
		if($result[6] == 25)
		{
			return 0;
		}
		
		if($plays['playid'] == 1472)
		{
			return substr($tehe,-1) > 4 ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 1473)
		{
			return substr($tehe,-1) < 5 ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特半波	49：和
	if($plays['parentid'] == 459)
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		//	红单
		if($plays['playid'] == 1441)
		{
			return $tehong && $tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	红双
		if($plays['playid'] == 1442)
		{
			return $tehong && !$tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	红大
		if($plays['playid'] == 1443)
		{
			return $tehong && $teda ? $data['money'] * $data['odds'] : 0;
		}
		//	红小
		if($plays['playid'] == 1444)
		{
			return $tehong && !$teda ? $data['money'] * $data['odds'] : 0;
		}
		//	蓝单
		if($plays['playid'] == 1445)
		{
			return $telan && $tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	蓝双
		if($plays['playid'] == 1446)
		{
			return $telan && !$tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	蓝大
		if($plays['playid'] == 1447)
		{
			return $telan && $teda ? $data['money'] * $data['odds'] : 0;
		}
		//	蓝小
		if($plays['playid'] == 1448)
		{
			return $telan && !$teda ? $data['money'] * $data['odds'] : 0;
		}
		//	绿单
		if($plays['playid'] == 1449)
		{
			return $telv && $tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	绿双
		if($plays['playid'] == 1450)
		{
			return $telv && !$tedan ? $data['money'] * $data['odds'] : 0;
		}
		//	绿大
		if($plays['playid'] == 1451)
		{
			return $telv && $teda ? $data['money'] * $data['odds'] : 0;
		}
		//	绿小
		if($plays['playid'] == 1452)
		{
			return $telv && !$teda ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	特肖
	if($plays['parentid'] == 467)
	{
		return $texiao == $data['rednum'] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码
	if($plays['parentid'] == 472)
	{
		$tmp = $result;
		unset($tmp[6]);
		return in_array($data['rednum'],$tmp) ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特一
	if($plays['parentid'] == 473)
	{
		return $data['rednum'] == $result[0] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特二
	if($plays['parentid'] == 474)
	{
		return $data['rednum'] == $result[1] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特三
	if($plays['parentid'] == 475)
	{
		return $data['rednum'] == $result[2] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特四
	if($plays['parentid'] == 476)
	{
		return $data['rednum'] == $result[3] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特五
	if($plays['parentid'] == 477)
	{
		return $data['rednum'] == $result[4] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码特六
	if($plays['parentid'] == 478)
	{
		return $data['rednum'] == $result[5] ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连码三中二
	if($plays['parentid'] == 503)
	{
		$tmp = $result;
		unset($tmp[6]);
		
		$tmp2 = explode(',',$data['rednum']);
		
		$tmp3 = 0;
		in_array($tmp2[0],$tmp) && $tmp3++;
		in_array($tmp2[1],$tmp) && $tmp3++;
		in_array($tmp2[2],$tmp) && $tmp3++;
		
		//	三全中按照三全中赔率支付，当前不处理
		return $tmp3 > 1 ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连码三全中
	if($plays['parentid'] == 504)
	{
		$tmp = $result;
		unset($tmp[6]);
		
		$tmp2 = explode(',',$data['rednum']);
		
		return in_array($tmp2[0],$tmp) && in_array($tmp2[1],$tmp) && in_array($tmp2[2],$tmp) ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连码二中
	if($plays['parentid'] == 505)
	{
		$tmp = $result;
		unset($tmp[6]);
		
		$tmp2 = explode(',',$data['rednum']);
		
		return in_array($tmp2[0],$tmp) && in_array($tmp2[1],$tmp) ? $data['money'] * $data['odds'] : 0;
	}
	
	//	一肖
	if($plays['parentid'] == 471)
	{
		$tmp = [Num2Animal(date('Y'),$result[0]),Num2Animal(date('Y'),$result[1]),Num2Animal(date('Y'),$result[2]),Num2Animal(date('Y'),$result[3]),Num2Animal(date('Y'),$result[4]),Num2Animal(date('Y'),$result[5]),Num2Animal(date('Y'),$result[6])];
		
		return in_array($data['rednum'],$tmp) ? $data['money'] * $data['odds'] : 0;
	}
	
	//	七色波
	if($plays['parentid'] == 873)
	{
		//	三个色，正码算1个
		$tmp1 = $tmp2 = $tmp3 = 0;
		for($i = 0; $i < 6; $i++)
		{
			if(in_array($result[$i],$bohong))
			{
				$tmp1++;
			}
			else if(in_array($result[$i],$bolan))
			{
				$tmp2++;
			}
			else if(in_array($result[$i],$bolv))
			{
				$tmp3++;
			}
		}
		
		//	特码算1.5个
		if(in_array($result[6],$bohong))
		{
			$tmp1++;
		}
		else if(in_array($result[6],$bolan))
		{
			$tmp2++;
		}
		else if(in_array($result[6],$bolv))
		{
			$tmp3++;
		}
		
		//	3红3蓝1.5绿	3红3绿1.5蓝	3蓝3绿1.5红：和
		$tmp4 = ($tmp1 == 3 && $tmp2 == 3) || ($tmp1 == 3 && $tmp3 == 3) || ($tmp2 == 3 && $tmp3 == 3);
		if($plays['playid'] == 20218)
		{
			return $tmp4 ? $data['money'] * $data['odds'] : 0;
		}
		
		//	和退回投资金
		if($tmp4)
		{
			return $data['money'];
		}
		
		//	红、蓝、绿
		if($plays['playid'] == 20215)
		{
			return ($tmp1 > $tmp2) && ($tmp1 > $tmp3) ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 20216)
		{
			return ($tmp2 > $tmp1) && ($tmp2 > $tmp3) ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 20217)
		{
			return ($tmp3 > $tmp1) && ($tmp3 > $tmp2) ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	尾数
	if($plays['parentid'] == 510)
	{
		$tmp = [substr($result[0],-1),substr($result[1],-1),substr($result[2],-1),substr($result[3],-1),substr($result[4],-1),substr($result[5],-1),substr($result[6],-1)];
		
		return in_array($data['rednum'],$tmp) ? $data['money'] * $data['odds'] : 0;
	}
	
	//	一肖	49：和
	if(in_array($plays['parentid'],[508,511,512,513,514,515,516,517,518,519,520]))
	{
		if($result[6] == 49)
		{
			return 0;
		}
		
		$tmp = explode(',',$data['rednum']);
		if(in_array($texiao,$tmp))	//	选择中
		{
			return in_array($plays['playid'],[1899,1901,1903,1905,1907,1909,1911,1913,1915,1917,1919]) ? $data['money'] * $data['odds'] : 0;
		}
		else	//	选择不中
		{
			return in_array($plays['playid'],[1900,1902,1904,1906,1908,1910,1912,1914,1916,1918,1920]) ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	不中
	if(in_array($plays['parentid'],[523,524,525,526,527,528,529,530]))
	{
		$zailimian = 0;
		$tmp = explode(',',$data['rednum']);
		foreach($tmp as $t2)
		{
			if(in_array($t2,$result))
			{
				$zailimian = 1;
				break;
			}
		}
		
		return !$zailimian ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连肖	正肖和平肖赔率不同
	if(in_array($plays['parentid'],[532,533,534,535]))
	{
		$tmp = [Num2Animal(date('Y'),$result[0]),Num2Animal(date('Y'),$result[1]),Num2Animal(date('Y'),$result[2]),Num2Animal(date('Y'),$result[3]),Num2Animal(date('Y'),$result[4]),Num2Animal(date('Y'),$result[5]),Num2Animal(date('Y'),$result[6])];
		
		$zailimian = 0;
		$tmp2 = explode(',',$data['rednum']);
		foreach($tmp2 as $t2)
		{
			if(in_array($t2,$tmp))
			{
				$zailimian = 1;
				break;
			}
		}
		
		return $zailimian ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连尾中
	if(in_array($plays['parentid'],[536,537,538]))
	{
		$tmp = [substr($result[0],-1),substr($result[1],-1),substr($result[2],-1),substr($result[3],-1),substr($result[4],-1),substr($result[5],-1),substr($result[6],-1)];
		
		$zailimian = 1;
		$tmp2 = explode(',',$data['rednum']);
		foreach($tmp2 as $t2)
		{
			if(!in_array($t2,$tmp))
			{
				$zailimian = 0;
				break;
			}
		}
		
		return $zailimian ? $data['money'] * $data['odds'] : 0;
	}
	
	//	连尾不中
	if(in_array($plays['parentid'],[539,540,541]))
	{
		$tmp = [substr($result[0],-1),substr($result[1],-1),substr($result[2],-1),substr($result[3],-1),substr($result[4],-1),substr($result[5],-1),substr($result[6],-1)];
		
		$zailimian = 0;
		$tmp2 = explode(',',$data['rednum']);
		foreach($tmp2 as $t2)
		{
			if(in_array($t2,$tmp))
			{
				$zailimian = 1;
				break;
			}
		}
		
		return !$zailimian ? $data['money'] * $data['odds'] : 0;
	}
	
	//	正码一VS正码二	49：和
	if($plays['parentid'] == 604)
	{
		if(in_array(49,[$result[0],$result[1]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2571)
		{
			return $result[0] > $result[1] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2572)
		{
			return $result[0] < $result[1] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码一VS正码三	49：和
	if($plays['parentid'] == 605)
	{
		if(in_array(49,[$result[0],$result[2]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2573)
		{
			return $result[0] > $result[2] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2574)
		{
			return $result[0] < $result[2] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码一VS正码四	49：和
	if($plays['parentid'] == 606)
	{
		if(in_array(49,[$result[0],$result[3]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2575)
		{
			return $result[0] > $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2576)
		{
			return $result[0] < $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码一VS正码五	49：和
	if($plays['parentid'] == 607)
	{
		if(in_array(49,[$result[0],$result[4]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2577)
		{
			return $result[0] > $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2578)
		{
			return $result[0] < $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码一VS正码六	49：和
	if($plays['parentid'] == 608)
	{
		if(in_array(49,[$result[0],$result[5]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2579)
		{
			return $result[0] > $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2580)
		{
			return $result[0] < $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码一VS特码	49：和
	if($plays['parentid'] == 609)
	{
		if(in_array(49,[$result[0],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2581)
		{
			return $result[0] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2582)
		{
			return $result[0] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码二VS正码三	49：和
	if($plays['parentid'] == 610)
	{
		if(in_array(49,[$result[1],$result[2]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2583)
		{
			return $result[1] > $result[2] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2584)
		{
			return $result[1] < $result[2] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码二VS正码四	49：和
	if($plays['parentid'] == 611)
	{
		if(in_array(49,[$result[1],$result[3]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2585)
		{
			return $result[1] > $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2586)
		{
			return $result[1] < $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码二VS正码五	49：和
	if($plays['parentid'] == 612)
	{
		if(in_array(49,[$result[1],$result[4]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2587)
		{
			return $result[1] > $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2588)
		{
			return $result[1] < $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码二VS正码六	49：和
	if($plays['parentid'] == 613)
	{
		if(in_array(49,[$result[1],$result[5]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2589)
		{
			return $result[1] > $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2590)
		{
			return $result[1] < $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码二VS特码	49：和
	if($plays['parentid'] == 614)
	{
		if(in_array(49,[$result[1],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2591)
		{
			return $result[1] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2592)
		{
			return $result[1] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码三VS正码四	49：和
	if($plays['parentid'] == 615)
	{
		if(in_array(49,[$result[2],$result[3]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2593)
		{
			return $result[2] > $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2594)
		{
			return $result[2] < $result[3] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码三VS正码五	49：和
	if($plays['parentid'] == 616)
	{
		if(in_array(49,[$result[2],$result[4]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2595)
		{
			return $result[2] > $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2596)
		{
			return $result[2] < $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码三VS正码六	49：和
	if($plays['parentid'] == 617)
	{
		if(in_array(49,[$result[2],$result[5]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2597)
		{
			return $result[2] > $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2598)
		{
			return $result[2] < $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码三VS特码	49：和
	if($plays['parentid'] == 618)
	{
		if(in_array(49,[$result[2],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2599)
		{
			return $result[2] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2600)
		{
			return $result[2] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码四VS正码五	49：和
	if($plays['parentid'] == 619)
	{
		if(in_array(49,[$result[3],$result[4]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2601)
		{
			return $result[3] > $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2602)
		{
			return $result[3] < $result[4] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码四VS正码六	49：和
	if($plays['parentid'] == 620)
	{
		if(in_array(49,[$result[3],$result[5]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2603)
		{
			return $result[3] > $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2604)
		{
			return $result[3] < $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码四VS特码	49：和
	if($plays['parentid'] == 621)
	{
		if(in_array(49,[$result[3],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2605)
		{
			return $result[3] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2606)
		{
			return $result[3] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码五VS正码六	49：和
	if($plays['parentid'] == 622)
	{
		if(in_array(49,[$result[4],$result[5]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2607)
		{
			return $result[4] > $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2608)
		{
			return $result[4] < $result[5] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码五VS特码	49：和
	if($plays['parentid'] == 623)
	{
		if(in_array(49,[$result[4],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2609)
		{
			return $result[4] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2610)
		{
			return $result[4] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	//	正码六VS特码	49：和
	if($plays['parentid'] == 624)
	{
		if(in_array(49,[$result[5],$result[6]]))
		{
			return 0;
		}
		
		if($plays['playid'] == 2611)
		{
			return $result[5] > $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		if($plays['playid'] == 2612)
		{
			return $result[5] < $result[6] ? $data['money'] * $data['odds'] : 0;
		}
		
		return 0;
	}
	
	return 0;
}

//	数字转生肖：year年份，num数字
function Num2Animal($year,$num)
{
	$animals = ['鼠','牛','虎','兔','龙','蛇','马','羊','猴','鸡','狗','猪'];
	$left = ($year - 2008) % 12;	//	以2008年鼠年对比
	
	$a = $b = [];
	for($i = 0; $i < ($left + 1); $i++)
	{
		$a[] = $animals[$i];
	}
	for($i = ($left + 1); $i < 12; $i++)
	{
		$b[] = $animals[$i];
	}
	$a = array_reverse($a);
	$b = array_reverse($b);
	$c = array_merge($a,$b);
	
	return $c[($num - 1) % 12];
}